﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestMatrix.Phone
{
    public class BugListAzure
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "projectname")]
        public string ProjectName { get; set; }

        [JsonProperty(PropertyName = "itemid")]
        public int ItemID { get; set; }

        [JsonProperty(PropertyName = "assignedto")]
        public string AssignedTo { get; set; }

        [JsonProperty(PropertyName = "state")]
        public string State { get; set; }

        [JsonProperty(PropertyName = "severity")]
        public string Severity { get; set; }

        [JsonProperty(PropertyName = "priority")]
        public string Priority { get; set; }

        [JsonProperty(PropertyName = "foundInEnvironment")]
        public string FoundInEnvironment { get; set; }

        [JsonProperty(PropertyName = "createdDate")]
        public DateTime CreatedDate { get; set; }

        [JsonProperty(PropertyName = "resolvedDate")]
        public DateTime ResolvedDate { get; set; }

        [JsonProperty(PropertyName = "closedDate")]
        public DateTime ClosedDate { get; set; }

        [JsonProperty(PropertyName = "projectFriendName")]
        public string ProjectFriendName { get; set; }

        [JsonProperty(PropertyName = "bugType")]
        public string BugType { get; set; }

        [JsonProperty(PropertyName = "createdBy")]
        public string CreatedBy { get; set; }

        [JsonProperty(PropertyName = "resolvedBy")]
        public string ResolvedBy { get; set; }
    }

    public class NumOfCreatedTCAzure
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "application")]
        public string Application { get; set; }

        [JsonProperty(PropertyName = "createdDate")]
        public string CreatedDate { get; set; }

        [JsonProperty(PropertyName = "numCreatedTC")]
        public int NumCreatedTC { get; set; }
    }

    public class NumOfExecutedTCAzure
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "application")]
        public string Application { get; set; }

        [JsonProperty(PropertyName = "executedStartDt")]
        public string ExecutedStartDt { get; set; }

        [JsonProperty(PropertyName = "numExecutedTC")]
        public int NumExecutedTC { get; set; }

        [JsonProperty(PropertyName = "numPassed")]
        public int NumPassed { get; set; }

        [JsonProperty(PropertyName = "numFailed")]
        public int NumFailed { get; set; }
    }

    public class TestAutomationAzure
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "application")]
        public string Application { get; set; }

        [JsonProperty(PropertyName = "createdDate")]
        public string CreatedDate { get; set; }

        [JsonProperty(PropertyName = "totalTestCases")]
        public int TotalTestCases { get; set; }

        [JsonProperty(PropertyName = "automatable")]
        public int Automatable { get; set; }

        [JsonProperty(PropertyName = "cannotAutomated")]
        public int CannotAutomated { get; set; }

        [JsonProperty(PropertyName = "automatableNotReady")]
        public int AutomatableNotReady { get; set; }

        [JsonProperty(PropertyName = "alreadyAutomated")]
        public int AlreadyAutomated { get; set; }

        [JsonProperty(PropertyName = "gap")]
        public int Gap { get; set; }

        [JsonProperty(PropertyName = "rateAlreadyAutomated")]
        public int RateAlreadyAutomated { get; set; }

        [JsonProperty(PropertyName = "rateAutomatable")]
        public int RateAutomatable { get; set; }

        [JsonProperty(PropertyName = "linesOfAutomationCode")]
        public int LinesOfAutomationCode { get; set; }
    }


    public class ReleaseInfoAzure
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "ebiProjectName")]
        public string EBIProjectName { get; set; }

        [JsonProperty(PropertyName = "YYYYMM")]
        public string YYYYMM { get; set; }

        [JsonProperty(PropertyName = "releaseCnt")]
        public int ReleaseCnt { get; set; }

        [JsonProperty(PropertyName = "releaseTimes")]
        public int ReleaseTimes { get; set; }

        [JsonProperty(PropertyName = "testCaseCnt")]
        public int TestCaseCnt { get; set; }

        [JsonProperty(PropertyName = "changeSetCnt")]
        public int ChangeSetCnt { get; set; }

        [JsonProperty(PropertyName = "fixedBug")]
        public int FixedBug { get; set; }

        [JsonProperty(PropertyName = "changeRequest")]
        public int ChangeRequest { get; set; }

        [JsonProperty(PropertyName = "feature")]
        public int Feature { get; set; }

        [JsonProperty(PropertyName = "issue")]
        public int Issue { get; set; }

        [JsonProperty(PropertyName = "task")]
        public int Task { get; set; }

        [JsonProperty(PropertyName = "userStory")]
        public int UserStory { get; set; }

        [JsonProperty(PropertyName = "action")]
        public string Action { get; set; }

        [JsonProperty(PropertyName = "lastUpdateDT")]
        public DateTime LastUpdateDT { get; set; }
    }

    /// <summary>
    /// Azure table model
    /// </summary>
    public class ReleaseDetailInfoAzure //Shall be the same name as Azure's table name
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "ebiProjectName")]
        public string EBIProjectName { get; set; }

        [JsonProperty(PropertyName = "YYYYMMDD")]
        public string YYYYMMDD { get; set; }

        [JsonProperty(PropertyName = "releaseCnt")]
        public int ReleaseCnt { get; set; }

        [JsonProperty(PropertyName = "releaseTimes")]
        public int ReleaseTimes { get; set; }

        [JsonProperty(PropertyName = "testCaseCnt")]
        public int TestCaseCnt { get; set; }

        [JsonProperty(PropertyName = "changeSetCnt")]
        public int ChangeSetCnt { get; set; }

        [JsonProperty(PropertyName = "fixedBug")]
        public int FixedBug { get; set; }

        [JsonProperty(PropertyName = "changeRequest")]
        public int ChangeRequest { get; set; }

        [JsonProperty(PropertyName = "feature")]
        public int Feature { get; set; }

        [JsonProperty(PropertyName = "issue")]
        public int Issue { get; set; }

        [JsonProperty(PropertyName = "task")]
        public int Task { get; set; }

        [JsonProperty(PropertyName = "userStory")]
        public int UserStory { get; set; }

    }

    public class TestCaseInCIAzure
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "ebiProjectName")]
        public string EBIProjectName { get; set; }

        [JsonProperty(PropertyName = "releasedTestCaseCnt")]
        public int ReleasedTestCaseCnt { get; set; }

        [JsonProperty(PropertyName = "testCaseInCI")]
        public int TestCaseInCI { get; set; }

        [JsonProperty(PropertyName = "testCase_Auto_CI")]
        public int TestCase_Auto_CI { get; set; }

        [JsonProperty(PropertyName = "testCase_Manual_CI")]
        public int TestCase_Manual_CI { get; set; }

        [JsonProperty(PropertyName = "uTCase_CI")]
        public int UTCase_CI { get; set; }

        [JsonProperty(PropertyName = "action")]
        public string Action { get; set; }

        [JsonProperty(PropertyName = "lastUpdateDT")]
        public DateTime LastUpdateDT { get; set; }
    }

    public class GlobalTestCasePassRateAzure
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "Financialyear")]
        public string Financialyear { get; set; }

        [JsonProperty(PropertyName = "ProjectName")]
        public string ProjectName { get; set; }

        [JsonProperty(PropertyName = "planName")]
        public string PlanName { get; set; }

        [JsonProperty(PropertyName = "passed")]
        public int Passed { get; set; }

        [JsonProperty(PropertyName = "failed")]
        public int Failed { get; set; }

        [JsonProperty(PropertyName = "notExecuted")]
        public int NotExecuted { get; set; }

        [JsonProperty(PropertyName = "total")]
        public int Total { get; set; }

        [JsonProperty(PropertyName = "passPercent")]
        public string PassPercent { get; set; }
    }

    public class GlobalTestCaseAutomationAzure
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "Financialyear")]
        public string Financialyear { get; set; }

        [JsonProperty(PropertyName = "Project")]
        public string Project { get; set; }

        [JsonProperty(PropertyName = "Automated")]
        public int Automated { get; set; }

        [JsonProperty(PropertyName = "HaveAutomationValue")]
        public int HaveAutomationValue { get; set; }

        [JsonProperty(PropertyName = "NotAutomationValue")]
        public int NotAutomationValue { get; set; }

        [JsonProperty(PropertyName = "AutomatedOfTotal")]
        public string AutomatedOfTotal { get; set; }

        [JsonProperty(PropertyName = "AutomatedOfAutomatable")]
        public string AutomatedOfAutomatable { get; set; }

    }

    public class GlobalDREAzure
    {
        public int Id { get; set; }

        [JsonProperty(PropertyName = "Financialyear")]
        public string Financialyear { get; set; }

        [JsonProperty(PropertyName = "Project")]
        public string Project { get; set; }

        [JsonProperty(PropertyName = "SITBugs")]
        public int SITBugs { get; set; }

        [JsonProperty(PropertyName = "ProductionUATBUGS")]
        public int ProductionUATBUGS { get; set; }

        [JsonProperty(PropertyName = "OtherBugs")]
        public int OtherBugs { get; set; }

        [JsonProperty(PropertyName = "DRE")]
        public string DRE { get; set; }

    }
}
